# -*- encoding=utf8 -*-
__author__ = "Simon"

from airtest.core.api import *
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()
using("../main.air")
import main

def jjc2():
    #获取旋转后的分辨率
    x,y=device().get_current_resolution()
    sleep(1)
    main.judge_sheet(x,y)
    sleep(1)
    main.risk_entry(x,y)
    #jjc
    sleep(1)
    touch([0.61*x,0.75*y])
    sleep(1)
    while exists(Template(r"tpl1596804467466.png")):
        sleep(2)
        main.cancel()
        sleep(1)
    if exists(Template(r"tpl1596804858374.png")):
        sleep(1)
        print("没有可以收取哦")
    else:
        sleep(1)
        touch([0.3*x,0.63*y])
        sleep(2)
        main.cilck_white_ok()
        sleep(1)
    touch([0.6*x,0.3*y])
    sleep(1)
    # touch([0.87*x,0.84*y])
    touch(Template(r"tpl1596805687380.png",threshold=0.6))
    sleep(60)
    main.next_step()
    sleep(3)
    touch([0.03*x,0.06*y])
    #pjjc
    sleep(1)
    touch([0.85*x,0.75*y])
    sleep(1)
    while exists(Template(r"tpl1596804467466.png")):
        sleep(2)
        main.cancel()
        sleep(1)
    if exists(Template(r"tpl1596804858374.png")):
        sleep(1)
        print("没有可以收取哦")
    else:
        sleep(1)
        touch([0.3*x,0.63*y])
        sleep(2)
        main.cilck_white_ok()
        sleep(3)
    touch([0.6*x,0.3*y])
    sleep(1)
    touch(Template(r"tpl1596805569786.png",threshold=0.6))
    sleep(1)
    touch(Template(r"tpl1596805585246.png"))
    sleep(1)
    touch(Template(r"tpl1596805687380.png",threshold=0.6))
    sleep(160)
    main.next_step()
    sleep(1)
    touch([0.03*x,0.06*y])
    sleep(2)
    main.sheet_entry(x,y)
    sleep(1)